﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Blade.Platform.X86;
using System.IO;
using Blade.Compilation;
using System.Diagnostics;
using Blade.Metadata;
using System.Reflection;
using Blade.Metadata.PeLoader;

namespace Blade.AotCompiler {
	class Program {
		static void Main(string[] args) {
			Debug.Listeners.Add(new ConsoleTraceListener());
			var program = new Program();
			program.Run();
			Console.WriteLine("[Press any key to exit]");
			Console.ReadKey();
		}

		private void Run() {
			var runtime = new Runtime();
			runtime.AddService<PlatformBase>((c) => new X86Platform());
			runtime.AddService<IMetadataLocator>((c) => new AotMetadataLocator());
			runtime.AddService<MetadataLoaderBase>((c) => new PeMetadataLoader(c));
			var loader = runtime.GetService<MetadataLoaderBase>();
			var assembly = loader.LoadAssembly(new AssemblyName("Test.Blade.AotCompiler"));

			throw new NotImplementedException();
		}
	}
}
